#include <iostream>
#include <cstdio>
#include <string>
#include <map>

std::map<std::string, float> mark;
int n;

int main()
{
	mark["A"]  = 4.0; mark["A-"] = 3.7;
	mark["B+"] = 3.3; mark["B"]  = 3.0; mark["B-"] = 2.7;
	mark["C+"] = 2.3; mark["C"]  = 2.0; mark["C-"] = 1.7;
	mark["D"]  = 1.3; mark["D-"] = 1.0;
	mark["F"]  = 0.0;

	while (std::cin >> n) {
		int sum = 0;
		float sum_cm = 0;
		for (int i = 0, credit; i < n; i++) {
			std::string m;
			std::cin >> credit >> m;
			if (m == "P" || m == "Pass" || m == "N" || m == "Not pass")
				continue;
			sum += credit;
			sum_cm += credit * mark[m];
		}

		if (sum == 0) std::printf("0.00\n");
		else 		  std::printf("%.2f\n", sum_cm/(float)sum);
	}
}

